import { Post, Get } from '../utils/http'

/**
 * 新增订单
 */
export const addOrderApi = (data = {}) =>
  Post({
    url: 'api/tbOrder/submit',
    data
  })

/**
 * 订单详情
 */
export const getOrderInfoApi = (data = {}) =>
  Get({
    url: 'api/tbOrder/detail',
    data
  })

/**
 * 订单列表
 */
export const getOrderListApi = (data = {}) =>
  Get({
    url: 'api/tbOrder/list',
    data
  })

/**
 * 修改订单
 */
export const updateOrderApi = (data = {}) =>
  Post({
    url: 'api/tbOrder/update',
    data
  })

/**
 * 新增物流
 */
export const addlogisticApi = (data = {}) =>
  Post({
    url: 'api/tbOrder/logistic/add',
    data
  })

/**
 * 获取物流
 */
export const getlogisticApi = (data = {}) =>
  Get({
    url: 'api/tbOrder/logistic/list',
    data
  })

/**
 * 提交发票
 */
export const addInvoiceApi = (data = {}) =>
  Post({
    url: 'api/invoice',
    data
  })

/**
 * 根据订单号获取物流信息
 */
export const getLogisticsTypeApi = (data = {}) =>
  Get({
    url: 'api/tbOrder/logistics',
    data
  })
